<?php

class vscitacisystemvytvor extends view {
        var $title = "Vytvor sćítací systém";
		var $scripts = array("jquery-1.9.1.min.js", "jquery.validate.js", "scitacisystemvytvor.js");
    
        
        public function main(){ 
		echo "<h2>Vytvorenie sčítacieho systému</h2>";
		echo  "<form action=\"/scitacisystem/vytvor\" method=\"post\" id=\"vytvorss\">";
?>
		  <table>                                                                              
			   <!-- vytvor form  -->
				  <tr>
					<td><label for="menoss">Meno: </label></td>
					<td><input type="text" name="menoss" id="menoss" 
					    value="<?php if (isset($this->data['menoss'])) echo $this->data['menoss']; ?>" /></td>
				  </tr>
				  <tr></tr>
				  <tr>
					<td><label for="popisss">Popis: </label></td>
					<td><textarea name="popisss" id="popisss" rows="4" cols="50"><?php if (isset($this->data['popisss'])) echo $this->data['popisss']; ?></textarea></td>
				  </tr>
				  <tr>
					<td><label for="bodyod">Min. počet bodov: </label></td>
					<td><input type="text" name="bodyod" id="bodyod" 
					    value="<?php if (isset($this->data['bodyod'])) echo $this->data['bodyod']; ?>" /></td>
				  </tr>
				  <tr></tr>
				  <tr>
					<td><label for="bodydo">Max. počet bodov: </label></td>
					<td><input type="text" name="bodydo" id="bodydo" 
					    value="<?php if (isset($this->data['bodydo'])) echo $this->data['bodydo']; ?>" /></td>
				  </tr>
				  <tr></tr>
				  <tr>
					<td><label for="zoradit">Zoradiť výsledky:</label></td>
					<td><input type="radio" name="zoradit" value="vzostupne" <?php if (isset($this->data['zoradit'])) { if ($this->data['zoradit']=='vzostupne'){echo'checked ';}}?> />Vzostupne<br />
					<input type="radio" name="zoradit" value="zostupne" <?php if (isset($this->data['zoradit'])) {if ($this->data['zoradit']=='zostupne'){echo'checked ';}}?> />Zostupne</td></tr>
				  <tr>
					<td>
					  <input type="submit" name="vytvor" value="Vytvorť" />
					</td>
				  </tr>
			   </table>
		  </form> 
<?php
		 if (isset($this->data['info'])){
			echo "<br /><pc class='red'><b>".$this->data['info']."</b><p/>";
		  }	
		   echo '<br /><a href="/scitacisystem/vypis">Späť na výpis sčítacích systémov</a>';	
         
         }
}
?>